<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/* asn1cades-2.0.0.js (c) 2014-2020 Kenji Urushima | kjur.github.com/jsrsasign/license
<span class='line'>  2</span>  */</span><span class="WHIT">
<span class='line'>  3</span> </span><span class="COMM">/*
<span class='line'>  4</span>  * asn1cades.js - ASN.1 DER encoder classes for RFC 5126 CAdES long term signature
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * Copyright (c) 2014-2020 Kenji Urushima (kenji.urushima@gmail.com)
<span class='line'>  7</span>  *
<span class='line'>  8</span>  * This software is licensed under the terms of the MIT License.
<span class='line'>  9</span>  * https://kjur.github.io/jsrsasign/license
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * The above copyright and license notice shall be 
<span class='line'> 12</span>  * included in all copies or substantial portions of the Software.
<span class='line'> 13</span>  */</span><span class="WHIT">
<span class='line'> 14</span> 
<span class='line'> 15</span> </span><span class="COMM">/**
<span class='line'> 16</span>  * @fileOverview
<span class='line'> 17</span>  * @name asn1cades-1.0.js
<span class='line'> 18</span>  * @author Kenji Urushima kenji.urushima@gmail.com
<span class='line'> 19</span>  * @version jsrsasign 10.0.0 asn1cades 2.0.0 (2020-Sep-22)
<span class='line'> 20</span>  * @since jsrsasign 4.7.0
<span class='line'> 21</span>  * @license &lt;a href="https://kjur.github.io/jsrsasign/license/">MIT License&lt;/a>
<span class='line'> 22</span>  */</span><span class="WHIT">
<span class='line'> 23</span> 
<span class='line'> 24</span> </span><span class="COMM">/** 
<span class='line'> 25</span>  * kjur's class library name space
<span class='line'> 26</span>  * // already documented in asn1-1.0.js
<span class='line'> 27</span>  * @name KJUR
<span class='line'> 28</span>  * @namespace kjur's class library name space
<span class='line'> 29</span>  */</span><span class="WHIT">
<span class='line'> 30</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">KJUR</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 31</span> 
<span class='line'> 32</span> </span><span class="COMM">/**
<span class='line'> 33</span>  * kjur's ASN.1 class library name space
<span class='line'> 34</span>  * // already documented in asn1-1.0.js
<span class='line'> 35</span>  * @name KJUR.asn1
<span class='line'> 36</span>  * @namespace
<span class='line'> 37</span>  */</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">KJUR.asn1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 39</span> 
<span class='line'> 40</span> </span><span class="COMM">/**
<span class='line'> 41</span>  * kjur's ASN.1 class for RFC 5126 CAdES long term signature
<span class='line'> 42</span>  * &lt;p>
<span class='line'> 43</span>  * This name space provides 
<span class='line'> 44</span>  * &lt;a href="https://tools.ietf.org/html/rfc5126">RFC 5126
<span class='line'> 45</span>  * CAdES(CMS Advanced Electronic Signature)&lt;/a> generator.
<span class='line'> 46</span>  *
<span class='line'> 47</span>  * &lt;h4>SUPPORTED FORMATS&lt;/h4>
<span class='line'> 48</span>  * Following CAdES formats is supported by this library.
<span class='line'> 49</span>  * &lt;ul>
<span class='line'> 50</span>  * &lt;li>CAdES-BES - CAdES Basic Electronic Signature&lt;/li>
<span class='line'> 51</span>  * &lt;li>CAdES-EPES - CAdES Explicit Policy-based Electronic Signature&lt;/li>
<span class='line'> 52</span>  * &lt;li>CAdES-T - Electronic Signature with Time&lt;/li>
<span class='line'> 53</span>  * &lt;/ul>
<span class='line'> 54</span>  * &lt;/p>
<span class='line'> 55</span>  *
<span class='line'> 56</span>  * &lt;h4>PROVIDED ATTRIBUTE CLASSES&lt;/h4>
<span class='line'> 57</span>  * &lt;ul>
<span class='line'> 58</span>  * &lt;li>{@link KJUR.asn1.cades.SignaturePolicyIdentifier} - for CAdES-EPES
<span class='line'> 59</span>  *   &lt;ul>
<span class='line'> 60</span>  *   &lt;li>{@link KJUR.asn1.cades.SignaturePolicyId}&lt;/li>
<span class='line'> 61</span>  *   &lt;/ul>
<span class='line'> 62</span>  * &lt;/li>
<span class='line'> 63</span>  * &lt;li>{@link KJUR.asn1.cades.SignatureTimeStamp} - for CAdES-T&lt;/li>
<span class='line'> 64</span>  * &lt;li>{@link KJUR.asn1.cades.CompleteCertificateRefs} - for CAdES-C(for future use)
<span class='line'> 65</span>  *   &lt;ul>
<span class='line'> 66</span>  *   &lt;li>{@link KJUR.asn1.cades.OtherCertID}&lt;/li>
<span class='line'> 67</span>  *   &lt;li>{@link KJUR.asn1.cades.OtherHash}&lt;/li>
<span class='line'> 68</span>  *   &lt;li>{@link KJUR.asn1.cades.OtherHashAlgAndValue}&lt;/li>
<span class='line'> 69</span>  *   &lt;li>{@link KJUR.asn1.cades.OtherHashValue}&lt;/li>
<span class='line'> 70</span>  *   &lt;/ul>
<span class='line'> 71</span>  * &lt;/li>
<span class='line'> 72</span>  * &lt;/ul>
<span class='line'> 73</span>  * NOTE: Currntly CAdES-C is not supported since parser can't
<span class='line'> 74</span>  * handle unsigned attribute.
<span class='line'> 75</span>  * 
<span class='line'> 76</span>  * &lt;h4>OTHER CLASSES&lt;/h4>
<span class='line'> 77</span>  * &lt;ul>
<span class='line'> 78</span>  * &lt;li>{@link KJUR.asn1.cades.CAdESUtil} - utilities for CAdES&lt;/li>
<span class='line'> 79</span>  * &lt;/ul>
<span class='line'> 80</span>  *
<span class='line'> 81</span>  * &lt;h4>GENERATE CAdES-BES&lt;/h4>
<span class='line'> 82</span>  * To generate CAdES-BES, {@link KJUR.asn.cades} namespace 
<span class='line'> 83</span>  * classes are not required and already {@link KJUR.asn.cms} namespace 
<span class='line'> 84</span>  * provides attributes for CAdES-BES.
<span class='line'> 85</span>  * Create {@link KJUR.asn1.cms.SignedData} with following
<span class='line'> 86</span>  * mandatory attribute in CAdES-BES:
<span class='line'> 87</span>  * &lt;ul>
<span class='line'> 88</span>  * &lt;li>{@link KJUR.asn1.cms.ContentType}&lt;/li>
<span class='line'> 89</span>  * &lt;li>{@link KJUR.asn1.cms.MessageDigest}&lt;/li>
<span class='line'> 90</span>  * &lt;li>{@link KJUR.asn1.cms.SigningCertificate} or &lt;/li>
<span class='line'> 91</span>  * &lt;li>{@link KJUR.asn1.cms.SigningCertificateV2}&lt;/li>
<span class='line'> 92</span>  * &lt;/ul>
<span class='line'> 93</span>  * CMSUtil.newSignedData method is very useful to generate CAdES-BES.
<span class='line'> 94</span>  * &lt;pre>
<span class='line'> 95</span>  * sd = KJUR.asn1.cms.CMSUtil.newSignedData({
<span class='line'> 96</span>  *   content: {str: "aaa"},
<span class='line'> 97</span>  *   certs: [certPEM],
<span class='line'> 98</span>  *   signerInfos: [{
<span class='line'> 99</span>  *     hashAlg: 'sha256',
<span class='line'>100</span>  *     sAttr: {SigningCertificateV2: {array: [certPEM]}},
<span class='line'>101</span>  *     signerCert: certPEM,
<span class='line'>102</span>  *     sigAlg: 'SHA256withRSA',
<span class='line'>103</span>  *     signerPrvKey: pkcs8PrvKeyPEM
<span class='line'>104</span>  *   }]
<span class='line'>105</span>  * });
<span class='line'>106</span>  * signedDataHex = sd.getContentInfoEncodedHex();
<span class='line'>107</span>  * &lt;/pre>
<span class='line'>108</span>  * NOTE: ContentType and MessageDigest signed attributes
<span class='line'>109</span>  * are automatically added by default.
<span class='line'>110</span>  *
<span class='line'>111</span>  * &lt;h4>GENERATE CAdES-BES with multiple signers&lt;/h4>
<span class='line'>112</span>  * If you need signature by multiple signers, you can 
<span class='line'>113</span>  * specify one or more items in 'signerInfos' property as below.
<span class='line'>114</span>  * &lt;pre>
<span class='line'>115</span>  * sd = KJUR.asn1.cms.CMSUtil.newSignedData({
<span class='line'>116</span>  *   content: {str: "aaa"},
<span class='line'>117</span>  *   certs: [certPEM1, certPEM2],
<span class='line'>118</span>  *   signerInfos: [{
<span class='line'>119</span>  *     hashAlg: 'sha256',
<span class='line'>120</span>  *     sAttr: {SigningCertificateV2: {array: [certPEM1]}},
<span class='line'>121</span>  *     signerCert: certPEM1,
<span class='line'>122</span>  *     sigAlg: 'SHA256withRSA',
<span class='line'>123</span>  *     signerPrvKey: pkcs8PrvKeyPEM1
<span class='line'>124</span>  *   },{
<span class='line'>125</span>  *     hashAlg: 'sha1',
<span class='line'>126</span>  *     sAttr: {SigningCertificateV2: {array: [certPEM2]}},
<span class='line'>127</span>  *     signerCert: certPEM2,
<span class='line'>128</span>  *     sigAlg: 'SHA1withRSA',
<span class='line'>129</span>  *     signerPrvKey: pkcs8PrvKeyPEM2
<span class='line'>130</span>  *   }]
<span class='line'>131</span>  * });
<span class='line'>132</span>  * signedDataHex = sd.getContentInfoEncodedHex();
<span class='line'>133</span>  * &lt;/pre>
<span class='line'>134</span>  *
<span class='line'>135</span>  * &lt;h4>GENERATE CAdES-EPES&lt;/h4>
<span class='line'>136</span>  * When you need a CAdES-EPES signature,
<span class='line'>137</span>  * you just need to add 'SignaturePolicyIdentifier'
<span class='line'>138</span>  * attribute as below.
<span class='line'>139</span>  * &lt;pre>
<span class='line'>140</span>  * sd = KJUR.asn1.cms.CMSUtil.newSignedData({
<span class='line'>141</span>  *   content: {str: "aaa"},
<span class='line'>142</span>  *   certs: [certPEM],
<span class='line'>143</span>  *   signerInfos: [{
<span class='line'>144</span>  *     hashAlg: 'sha256',
<span class='line'>145</span>  *     sAttr: {
<span class='line'>146</span>  *       SigningCertificateV2: {array: [certPEM]},
<span class='line'>147</span>  *       SignaturePolicyIdentifier: {
<span class='line'>148</span>  *         oid: '1.2.3.4.5',
<span class='line'>149</span>  *         hash: {alg: 'sha1', hash: 'b1b2b3b4b...'}
<span class='line'>150</span>  *       },
<span class='line'>151</span>  *     },
<span class='line'>152</span>  *     signerCert: certPEM,
<span class='line'>153</span>  *     sigAlg: 'SHA256withRSA',
<span class='line'>154</span>  *     signerPrvKey: pkcs8PrvKeyPEM
<span class='line'>155</span>  *   }]
<span class='line'>156</span>  * });
<span class='line'>157</span>  * signedDataHex = sd.getContentInfoEncodedHex();
<span class='line'>158</span>  * &lt;/pre>
<span class='line'>159</span>  *
<span class='line'>160</span>  * &lt;h4>GENERATE CAdES-T&lt;/h4>
<span class='line'>161</span>  * After a signed CAdES-BES or CAdES-EPES signature have been generated,
<span class='line'>162</span>  * you can generate CAdES-T by adding SigningTimeStamp unsigned attribute.
<span class='line'>163</span>  * &lt;pre>
<span class='line'>164</span>  * beshex = "30..."; // hex of CAdES-BES or EPES data 
<span class='line'>165</span>  * info = KJUR.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned(beshex);
<span class='line'>166</span>  * // You can refer a hexadecimal string of signature value 
<span class='line'>167</span>  * // in the first signerInfo in the CAdES-BES/EPES with a variable:
<span class='line'>168</span>  * // 'info.si[0].sigval'. You need to get RFC 3161 TimeStampToken
<span class='line'>169</span>  * // from a trusted time stamp authority. Otherwise you can also 
<span class='line'>170</span>  * // get it by 'KJUR.asn1.tsp' module. We suppose that we could 
<span class='line'>171</span>  * // get proper time stamp.
<span class='line'>172</span>  * tsthex0 = "30..."; // hex of TimeStampToken for signerInfo[0] sigval
<span class='line'>173</span>  * si0 = info.obj.signerInfoList[0];
<span class='line'>174</span>  * si0.addUnsigned(new KJUR.asn1.cades.SignatureTimeStamp({tst: tsthex0});
<span class='line'>175</span>  * esthex = info.obj.getContentInfoEncodedHex(); // CAdES-T
<span class='line'>176</span>  * &lt;/pre>
<span class='line'>177</span>  * &lt;/p>
<span class='line'>178</span>  *
<span class='line'>179</span>  * &lt;h4>SAMPLE CODES&lt;/h4>
<span class='line'>180</span>  * &lt;ul>
<span class='line'>181</span>  * &lt;li>&lt;a href="../../tool_cades.html">demo program for CAdES-BES/EPES/T generation&lt;/a>&lt;/li>
<span class='line'>182</span>  * &lt;li>&lt;a href="../../test/qunit-do-asn1cades.html">Unit test code for KJUR.asn1.cades package&lt;/a>&lt;/li>
<span class='line'>183</span>  * &lt;li>&lt;a href="../../test/qunit-do-asn1tsp.html">Unit test code for KJUR.asn1.tsp package (See SimpleTSAAdaptor test)&lt;/a>&lt;/li>
<span class='line'>184</span>  * &lt;li>&lt;a href="../../test/qunit-do-asn1cms.html">Unit test code for KJUR.asn1.cms package (See newSignedData test)&lt;/a>&lt;/li>
<span class='line'>185</span>  * &lt;/ul>
<span class='line'>186</span>  * 
<span class='line'>187</span>  * @name KJUR.asn1.cades
<span class='line'>188</span>  * @namespace
<span class='line'>189</span>  */</span><span class="WHIT">
<span class='line'>190</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.cades</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">KJUR.asn1.cades</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>191</span> 
<span class='line'>192</span> </span><span class="COMM">/**
<span class='line'>193</span>  * class for RFC 5126 CAdES SignaturePolicyIdentifier attribute
<span class='line'>194</span>  * @name KJUR.asn1.cades.SignaturePolicyIdentifier
<span class='line'>195</span>  * @class class for RFC 5126 CAdES SignaturePolicyIdentifier attribute
<span class='line'>196</span>  * @param {Array} params associative array of parameters
<span class='line'>197</span>  * @extends KJUR.asn1.cms.Attribute
<span class='line'>198</span>  * @since jsrsasign 4.7.0 asn1cades 1.0.0
<span class='line'>199</span>  * @see KJUR.asn1.cms.AttributeList
<span class='line'>200</span>  * @see KJUR.asn1.cades.SignaturePolicyId
<span class='line'>201</span>  * @see KJUR.asn1.cades.OtherHashAlgAndValue
<span class='line'>202</span>  *
<span class='line'>203</span>  * @description
<span class='line'>204</span>  * This class provides ASN.1 encoder for
<span class='line'>205</span>  * &lt;a href="https://tools.ietf.org/html/rfc5126#section-5.8.1">
<span class='line'>206</span>  * SignaturePolicyIdentifier defined in RFC 5126 CAdES section 5.8.1&lt;/a>.
<span class='line'>207</span>  * &lt;pre>
<span class='line'>208</span>  * SignaturePolicyIdentifier ::= CHOICE {
<span class='line'>209</span>  *    signaturePolicyId       SignaturePolicyId,
<span class='line'>210</span>  *    signaturePolicyImplied  SignaturePolicyImplied } -- not used
<span class='line'>211</span>  *
<span class='line'>212</span>  * SignaturePolicyImplied ::= NULL
<span class='line'>213</span>  * SignaturePolicyId ::= SEQUENCE {
<span class='line'>214</span>  *    sigPolicyId           SigPolicyId,
<span class='line'>215</span>  *    sigPolicyHash         SigPolicyHash,
<span class='line'>216</span>  *    sigPolicyQualifiers   SEQUENCE SIZE (1..MAX) OF
<span class='line'>217</span>  *                             SigPolicyQualifierInfo OPTIONAL }
<span class='line'>218</span>  * SigPolicyId ::= OBJECT IDENTIFIER
<span class='line'>219</span>  * SigPolicyHash ::= OtherHashAlgAndValue
<span class='line'>220</span>  * &lt;/pre>
<span class='line'>221</span>  *
<span class='line'>222</span>  * @example
<span class='line'>223</span>  * new KJUR.asn1.cades.SignaturePolicyIdentifier({
<span class='line'>224</span>  *   attr: "signaturePolicyIdentifier",
<span class='line'>225</span>  *   oid: '1.2.3.4.5',
<span class='line'>226</span>  *   alg: 'sha1',
<span class='line'>227</span>  *   hash: 'a1a2a3a4...'
<span class='line'>228</span>  * })
<span class='line'>229</span>  */</span><span class="WHIT">
<span class='line'>230</span> </span><span class="NAME">KJUR.asn1.cades.SignaturePolicyIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT">	</span><span class="NAME">_SignaturePolicyId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.SignaturePolicyId</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT">	
<span class='line'>236</span>     </span><span class="NAME">_KJUR_asn1_cades.SignaturePolicyIdentifier.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>237</span> 
<span class='line'>238</span> </span><span class="WHIT">    </span><span class="NAME">this.typeOid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"1.2.840.113549.1.9.16.2.15"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> 
<span class='line'>240</span> </span><span class="WHIT">    </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>241</span> 
<span class='line'>242</span> </span><span class="WHIT">    </span><span class="NAME">this.getValueArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_SignaturePolicyId</span><span class="PUNC">(</span><span class="NAME">this.params</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>245</span> 
<span class='line'>246</span> </span><span class="WHIT">    </span><span class="NAME">this.setByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">	</span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span> 
<span class='line'>250</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>251</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.SignaturePolicyIdentifier</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT">                  </span><span class="NAME">KJUR.asn1.cms.Attribute</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>254</span> 
<span class='line'>255</span> </span><span class="COMM">/**
<span class='line'>256</span>  * RFC 5126 CAdES SignaturePolicyId ASN.1 structure class&lt;br/>
<span class='line'>257</span>  * @name KJUR.asn1.cades.SignaturePolicyId
<span class='line'>258</span>  * @class RFC 5126 CAdES SignaturePolicyId ASN.1 structure class
<span class='line'>259</span>  * @param {Array} params JSON object of parameters
<span class='line'>260</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>261</span>  * @since jsrsasign 10.0.0 asn1cades 2.0.0
<span class='line'>262</span>  * @see KJUR.asn1.cades.SignaturePolicyIdentifier
<span class='line'>263</span>  * @see KJUR.asn1.cades.OtherHashAlgAndValue
<span class='line'>264</span>  *
<span class='line'>265</span>  * @description
<span class='line'>266</span>  * This class provides ASN.1 encoder for
<span class='line'>267</span>  * &lt;a href="https://tools.ietf.org/html/rfc5126#section-5.8.1">
<span class='line'>268</span>  * SignaturePolicyId defined in RFC 5126 CAdES section 5.8.1&lt;/a>.
<span class='line'>269</span>  * &lt;pre>
<span class='line'>270</span>  * SignaturePolicyId ::= SEQUENCE {
<span class='line'>271</span>  *    sigPolicyId           SigPolicyId,
<span class='line'>272</span>  *    sigPolicyHash         SigPolicyHash,
<span class='line'>273</span>  *    sigPolicyQualifiers   SEQUENCE SIZE (1..MAX) OF
<span class='line'>274</span>  *                             SigPolicyQualifierInfo OPTIONAL }
<span class='line'>275</span>  * SigPolicyId ::= OBJECT IDENTIFIER
<span class='line'>276</span>  * SigPolicyHash ::= OtherHashAlgAndValue
<span class='line'>277</span>  * OtherHashAlgAndValue ::= SEQUENCE {
<span class='line'>278</span>  *    hashAlgorithm   AlgorithmIdentifier,
<span class='line'>279</span>  *    hashValue       OtherHashValue }
<span class='line'>280</span>  * OtherHashValue ::= OCTET STRING
<span class='line'>281</span>  * &lt;/pre>
<span class='line'>282</span>  * Following properties can be apply to constructor arguments 
<span class='line'>283</span>  * adding to {@link KJUR.asn1.cades.OtherHashAlgAndValue} constructor:
<span class='line'>284</span>  * &lt;ul>
<span class='line'>285</span>  * &lt;li>{String} oid - signature policy OID string or name (ex. 1.2.3.4)&lt;/li>
<span class='line'>286</span>  * &lt;/ul>
<span class='line'>287</span>  * 
<span class='line'>288</span>  * @example
<span class='line'>289</span>  * new KJUR.asn1.cades.SignaturePolicyId({
<span class='line'>290</span>  *   oid: "1.2.3.4.5",
<span class='line'>291</span>  *   alg: "sha256",
<span class='line'>292</span>  *   hash: "1234abcd..."
<span class='line'>293</span>  * });
<span class='line'>294</span>  */</span><span class="WHIT">
<span class='line'>295</span> </span><span class="NAME">KJUR.asn1.cades.SignaturePolicyId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT">	</span><span class="NAME">_DERSequence</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.DERSequence</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">	</span><span class="NAME">_DERObjectIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.DERObjectIdentifier</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_x509</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.x509</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">	</span><span class="NAME">_AlgorithmIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_x509.AlgorithmIdentifier</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT">	</span><span class="NAME">_SignaturePolicyId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.SignaturePolicyId</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT">	</span><span class="NAME">_OtherHashAlgAndValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.OtherHashAlgAndValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span> 
<span class='line'>306</span> </span><span class="WHIT">    </span><span class="NAME">_SignaturePolicyId.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>307</span> 
<span class='line'>308</span> </span><span class="WHIT">    </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>309</span> 
<span class='line'>310</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>312</span> 
<span class='line'>313</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT">	</span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_DERObjectIdentifier</span><span class="PUNC">(</span><span class="NAME">params.oid</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">	</span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_OtherHashAlgAndValue</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">array</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> 
<span class='line'>320</span> </span><span class="WHIT">    </span><span class="NAME">this.setByParam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT">	</span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>323</span> 
<span class='line'>324</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>325</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>326</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.SignaturePolicyId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> 
<span class='line'>328</span> </span><span class="COMM">/**
<span class='line'>329</span>  * class for OtherHashAlgAndValue ASN.1 object&lt;br/>
<span class='line'>330</span>  * @name KJUR.asn1.cades.OtherHashAlgAndValue
<span class='line'>331</span>  * @class class for OtherHashAlgAndValue ASN.1 object
<span class='line'>332</span>  * @param {Array} params associative array of parameters
<span class='line'>333</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>334</span>  * @since jsrsasign 4.7.0 asn1cades 1.0.0
<span class='line'>335</span>  *
<span class='line'>336</span>  * @description
<span class='line'>337</span>  * This class provides ASN.1 encoder for
<span class='line'>338</span>  * &lt;a href="https://tools.ietf.org/html/rfc5126#section-5.8.1">
<span class='line'>339</span>  * OtherHashAlgAndValue defined in RFC 5126 CAdES section 5.8.1&lt;/a>.
<span class='line'>340</span>  * &lt;pre>
<span class='line'>341</span>  * OtherHashAlgAndValue ::= SEQUENCE {
<span class='line'>342</span>  *    hashAlgorithm   AlgorithmIdentifier,
<span class='line'>343</span>  *    hashValue       OtherHashValue }
<span class='line'>344</span>  * OtherHashValue ::= OCTET STRING
<span class='line'>345</span>  * &lt;/pre>
<span class='line'>346</span>  * Following properties can be apply to constructor arguments:
<span class='line'>347</span>  * &lt;ul>
<span class='line'>348</span>  * &lt;li>{String} alg - hash algorithm name for "hashAlgorithm" field&lt;/li>
<span class='line'>349</span>  * &lt;li>{String} hash - hexadecimal string for "hashValue" field&lt;/li>
<span class='line'>350</span>  * &lt;/ul>
<span class='line'>351</span>  * 
<span class='line'>352</span>  * @example
<span class='line'>353</span>  * // specify by hash
<span class='line'>354</span>  * new KJUR.asn1.cades.OtherHashAlgAndValue({
<span class='line'>355</span>  *   alg: "sha256",
<span class='line'>356</span>  *   hash: "12abcd..."
<span class='line'>357</span>  * })
<span class='line'>358</span>  *
<span class='line'>359</span>  * // or specify by cert PEM or hex
<span class='line'>360</span>  * new KJUR.asn1.cades.OtherHashAlgAndValue({
<span class='line'>361</span>  *   alg: "sha256",
<span class='line'>362</span>  *   cert: "-----BEGIN..."
<span class='line'>363</span>  * })
<span class='line'>364</span>  * new KJUR.asn1.cades.OtherHashAlgAndValue({
<span class='line'>365</span>  *   alg: "sha256",
<span class='line'>366</span>  *   cert: "3082..."
<span class='line'>367</span>  * })
<span class='line'>368</span>  */</span><span class="WHIT">
<span class='line'>369</span> </span><span class="NAME">KJUR.asn1.cades.OtherHashAlgAndValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT">	</span><span class="NAME">_DERSequence</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.DERSequence</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT">	</span><span class="NAME">_DEROctetString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.DEROctetString</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_x509</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.x509</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT">	</span><span class="NAME">_AlgorithmIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_x509.AlgorithmIdentifier</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>378</span> </span><span class="WHIT">	</span><span class="NAME">_OtherHashAlgAndValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.OtherHashAlgAndValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>379</span> 
<span class='line'>380</span> </span><span class="WHIT">    </span><span class="NAME">_OtherHashAlgAndValue.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>381</span> 
<span class='line'>382</span> </span><span class="WHIT">    </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>383</span> 
<span class='line'>384</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>386</span> 
<span class='line'>387</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.alg</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT">	    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"property 'alg' not specified"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>389</span> 
<span class='line'>390</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.hash</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">params.cert</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">	    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"property 'hash' nor 'cert' not specified"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>392</span> 
<span class='line'>393</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.hash</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT">	    </span><span class="NAME">hHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.hash</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.cert</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.cert</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"cert not string"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span> 
<span class='line'>400</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.cert</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.cert.indexOf</span><span class="PUNC">(</span><span class="STRN">"-----BEGIN"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT">		</span><span class="NAME">hCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pemtohex</span><span class="PUNC">(</span><span class="NAME">params.cert</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>403</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>404</span> </span><span class="WHIT">	    </span><span class="NAME">hHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.Util.hashHex</span><span class="PUNC">(</span><span class="NAME">hCert</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">params.alg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>405</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>406</span> 
<span class='line'>407</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>408</span> </span><span class="WHIT">	</span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_AlgorithmIdentifier</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params.alg</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT">	</span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_DEROctetString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hHash</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>410</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">array</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>413</span> 
<span class='line'>414</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>415</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>416</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.OtherHashAlgAndValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>417</span> 
<span class='line'>418</span> </span><span class="COMM">/**
<span class='line'>419</span>  * class for OtherHashValue ASN.1 object&lt;br/>
<span class='line'>420</span>  * @name KJUR.asn1.cades.OtherHashValue
<span class='line'>421</span>  * @class class for OtherHashValue ASN.1 object
<span class='line'>422</span>  * @param {Array} params JSON object of parameters
<span class='line'>423</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>424</span>  * @since jsrsasign 10.0.0 asn1cades 2.0.0
<span class='line'>425</span>  *
<span class='line'>426</span>  * This class provides ASN.1 encoder for
<span class='line'>427</span>  * &lt;a href="https://tools.ietf.org/html/rfc5126#section-5.8.1">
<span class='line'>428</span>  * OtherHashAlgAndValue defined in RFC 5126 CAdES section 5.8.1&lt;/a>.
<span class='line'>429</span>  * &lt;pre>
<span class='line'>430</span>  * OtherHashValue ::= OCTET STRING
<span class='line'>431</span>  * &lt;/pre>
<span class='line'>432</span>  *
<span class='line'>433</span>  * @example
<span class='line'>434</span>  * new KJUR.asn1.cades.OtherHashValue({hash: "12ab..."})
<span class='line'>435</span>  * new KJUR.asn1.cades.OtherHashValue({cert: "-----BEGIN..."})
<span class='line'>436</span>  * new KJUR.asn1.cades.OtherHashValue({cert: "3081..."})
<span class='line'>437</span>  */</span><span class="WHIT">
<span class='line'>438</span> </span><span class="NAME">KJUR.asn1.cades.OtherHashValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT">    </span><span class="NAME">KJUR.asn1.cades.OtherHashValue.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>440</span> 
<span class='line'>441</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">	</span><span class="NAME">_isHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.lang.String.isHex</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">	</span><span class="NAME">_DEROctetString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.DEROctetString</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT">	</span><span class="NAME">_hashHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.crypto.Util.hashHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT">    
<span class='line'>448</span>     </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>449</span> 
<span class='line'>450</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>452</span> 
<span class='line'>453</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.hash</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">params.cert</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT">	    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"hash or cert not specified"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>456</span> 
<span class='line'>457</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.hash</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT">	    </span><span class="NAME">hHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.hash</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.cert</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>461</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params.cert</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"cert not string"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.cert</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.cert.indexOf</span><span class="PUNC">(</span><span class="STRN">"-----BEGIN"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT">		</span><span class="NAME">hCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pemtohex</span><span class="PUNC">(</span><span class="NAME">params.cert</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">	    </span><span class="NAME">hHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.Util.hashHex</span><span class="PUNC">(</span><span class="NAME">hCert</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"sha1"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_DEROctetString</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">hex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hHash</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>472</span> 
<span class='line'>473</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>474</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>475</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.OtherHashValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>476</span> 
<span class='line'>477</span> </span><span class="COMM">/**
<span class='line'>478</span>  * class for RFC 5126 CAdES SignatureTimeStamp attribute&lt;br/>
<span class='line'>479</span>  * @name KJUR.asn1.cades.SignatureTimeStamp
<span class='line'>480</span>  * @class class for RFC 5126 CAdES SignatureTimeStamp attribute
<span class='line'>481</span>  * @param {Array} params associative array of parameters
<span class='line'>482</span>  * @extends KJUR.asn1.cms.Attribute
<span class='line'>483</span>  * @since jsrsasign 4.7.0 asn1cades 1.0.0
<span class='line'>484</span>  * @description
<span class='line'>485</span>  * &lt;pre>
<span class='line'>486</span>  * id-aa-signatureTimeStampToken OBJECT IDENTIFIER ::=
<span class='line'>487</span>  *    1.2.840.113549.1.9.16.2.14
<span class='line'>488</span>  * SignatureTimeStampToken ::= TimeStampToken
<span class='line'>489</span>  * &lt;/pre>
<span class='line'>490</span>  *
<span class='line'>491</span>  * @example
<span class='line'>492</span>  * // by TimeStampToken hex
<span class='line'>493</span>  * new KJUR.asn1.cades.SignatureTimeStamp({
<span class='line'>494</span>  *   attr: "timeStampToken",
<span class='line'>495</span>  *   tst: "3082..."})
<span class='line'>496</span>  *
<span class='line'>497</span>  * // by TimeStampToken or ASN1Object
<span class='line'>498</span>  * new KJUR.asn1.cades.SignatureTimeStamp({
<span class='line'>499</span>  *   attr: "timeStampToken",
<span class='line'>500</span>  *   tst: new TimeStampToken(...)})
<span class='line'>501</span>  *
<span class='line'>502</span>  * // by TimeStampResponse hex
<span class='line'>503</span>  * new KJUR.asn1.cades.SignatureTimeStamp({
<span class='line'>504</span>  *   attr: "timeStampToken",
<span class='line'>505</span>  *   res: "3082..."})
<span class='line'>506</span>  *
<span class='line'>507</span>  * // by TimeStampToken or ASN1Object
<span class='line'>508</span>  * new KJUR.asn1.cades.SignatureTimeStamp({
<span class='line'>509</span>  *   attr: "timeStampToken",
<span class='line'>510</span>  *   res: new TimeStampResponse(...)})
<span class='line'>511</span>  */</span><span class="WHIT">
<span class='line'>512</span> </span><span class="NAME">KJUR.asn1.cades.SignatureTimeStamp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">	</span><span class="NAME">_isHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.lang.String.isHex</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT">	</span><span class="NAME">_ASN1Object</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.ASN1Object</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_x509</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.x509</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span> 
<span class='line'>521</span> </span><span class="WHIT">    </span><span class="NAME">_KJUR_asn1_cades.SignatureTimeStamp.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">    </span><span class="NAME">this.typeOid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"1.2.840.113549.1.9.16.2.14"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>523</span> </span><span class="WHIT">    </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>524</span> 
<span class='line'>525</span> </span><span class="WHIT">    </span><span class="NAME">this.getValueArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>527</span> 
<span class='line'>528</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.tst</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_isHex</span><span class="PUNC">(</span><span class="NAME">params.tst</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dTST</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT">		</span><span class="NAME">dTST.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.tst</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">dTST</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.tst</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT">		</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">params.tst</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>536</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"params.tst has wrong value"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.res</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hRes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.res</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hRes</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT">		</span><span class="NAME">hRes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hRes.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">hRes</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">_isHex</span><span class="PUNC">(</span><span class="NAME">hRes</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">		</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"params.res has wrong value"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hTST</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getTLVbyList</span><span class="PUNC">(</span><span class="NAME">hRes</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>547</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dTST</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span> </span><span class="WHIT">	    </span><span class="NAME">dTST.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.tst</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>549</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">dTST</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>550</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>552</span> 
<span class='line'>553</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>554</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>555</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.SignatureTimeStamp</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>556</span> </span><span class="WHIT">                  </span><span class="NAME">KJUR.asn1.cms.Attribute</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>557</span> 
<span class='line'>558</span> </span><span class="COMM">/**
<span class='line'>559</span>  * class for RFC 5126 CAdES CompleteCertificateRefs attribute&lt;br/>
<span class='line'>560</span>  * @name KJUR.asn1.cades.CompleteCertificateRefs
<span class='line'>561</span>  * @class class for RFC 5126 CAdES CompleteCertificateRefs attribute
<span class='line'>562</span>  * @param {Array} params associative array of parameters
<span class='line'>563</span>  * @extends KJUR.asn1.cms.Attribute
<span class='line'>564</span>  * @since jsrsasign 4.7.0 asn1cades 1.0.0
<span class='line'>565</span>  *
<span class='line'>566</span>  * @description
<span class='line'>567</span>  * &lt;pre>
<span class='line'>568</span>  * id-aa-ets-certificateRefs OBJECT IDENTIFIER = 
<span class='line'>569</span>  *    1.2.840.113549.1.9.16.2.21
<span class='line'>570</span>  * CompleteCertificateRefs ::=  SEQUENCE OF OtherCertID
<span class='line'>571</span>  * OtherCertID ::= SEQUENCE {
<span class='line'>572</span>  *    otherCertHash    OtherHash,
<span class='line'>573</span>  *    issuerSerial     IssuerSerial OPTIONAL }
<span class='line'>574</span>  * OtherHash ::= CHOICE {
<span class='line'>575</span>  *    sha1Hash   OtherHashValue,  -- This contains a SHA-1 hash
<span class='line'>576</span>  *    otherHash  OtherHashAlgAndValue}
<span class='line'>577</span>  * OtherHashAlgAndValue ::= SEQUENCE {
<span class='line'>578</span>  *    hashAlgorithm   AlgorithmIdentifier,
<span class='line'>579</span>  *    hashValue       OtherHashValue }
<span class='line'>580</span>  * OtherHashValue ::= OCTET STRING
<span class='line'>581</span>  * &lt;/pre>
<span class='line'>582</span>  *
<span class='line'>583</span>  * @example
<span class='line'>584</span>  * o = new KJUR.asn1.cades.CompleteCertificateRefs({
<span class='line'>585</span>  *   array: [certPEM1,certPEM2],
<span class='line'>586</span>  *   otherhash: true // OPTION
<span class='line'>587</span>  * });
<span class='line'>588</span>  */</span><span class="WHIT">
<span class='line'>589</span> </span><span class="NAME">KJUR.asn1.cades.CompleteCertificateRefs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>590</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>591</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>592</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>593</span> </span><span class="WHIT">	</span><span class="NAME">_DERSequence</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.DERSequence</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>594</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>595</span> </span><span class="WHIT">	</span><span class="NAME">_OtherCertID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.OtherCertID</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>596</span> </span><span class="WHIT">	</span><span class="NAME">_isHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.lang.String.isHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>597</span> 
<span class='line'>598</span> </span><span class="WHIT">    </span><span class="NAME">_KJUR_asn1_cades.CompleteCertificateRefs.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>599</span> </span><span class="WHIT">    </span><span class="NAME">this.typeOid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"1.2.840.113549.1.9.16.2.21"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>600</span> </span><span class="WHIT">    
<span class='line'>601</span>     </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>602</span> 
<span class='line'>603</span> </span><span class="WHIT">    </span><span class="NAME">this.getValueArray</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>604</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>605</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>606</span> 
<span class='line'>607</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">params.array.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>608</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pOtherCertID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.array</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>609</span> 
<span class='line'>610</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">pOtherCertID</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>611</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pOtherCertID.indexOf</span><span class="PUNC">(</span><span class="STRN">"-----BEGIN"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>612</span> </span><span class="WHIT">		    </span><span class="NAME">pOtherCertID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">cert</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">pOtherCertID</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>613</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_isHex</span><span class="PUNC">(</span><span class="NAME">pOtherCertID</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>614</span> </span><span class="WHIT">		    </span><span class="NAME">pOtherCertID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">hash</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">pOtherCertID</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>615</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>616</span> </span><span class="WHIT">		    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="PUNC">(</span><span class="STRN">"unsupported value: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pOtherCertID</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>617</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>618</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>619</span> 
<span class='line'>620</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.alg</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">pOtherCertID.alg</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>621</span> </span><span class="WHIT">		</span><span class="NAME">pOtherCertID.alg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.alg</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>622</span> 
<span class='line'>623</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.hasis</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">pOtherCertID.hasis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT">		</span><span class="NAME">pOtherCertID.hasis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params.hasis</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>625</span> 
<span class='line'>626</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dOtherCertID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_OtherCertID</span><span class="PUNC">(</span><span class="NAME">pOtherCertID</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>627</span> </span><span class="WHIT">	    </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">dOtherCertID</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>628</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>629</span> 
<span class='line'>630</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">array</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>631</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">seq</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>632</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>633</span> 
<span class='line'>634</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>635</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>636</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.CompleteCertificateRefs</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>637</span> </span><span class="WHIT">                  </span><span class="NAME">KJUR.asn1.cms.Attribute</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>638</span> 
<span class='line'>639</span> </span><span class="COMM">/**
<span class='line'>640</span>  * class for OtherCertID ASN.1 object
<span class='line'>641</span>  * @name KJUR.asn1.cades.OtherCertID
<span class='line'>642</span>  * @class class for OtherCertID ASN.1 object
<span class='line'>643</span>  * @param {Array} params associative array of parameters
<span class='line'>644</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>645</span>  * @since jsrsasign 4.7.0 asn1cades 1.0.0
<span class='line'>646</span>  * @see KJUR.asn1.cms.IssuerSerial
<span class='line'>647</span>  * @see KJUR.asn1.cms.ESSCertID
<span class='line'>648</span>  * @see KJUR.asn1.cms.ESSCertIDv2
<span class='line'>649</span>  *
<span class='line'>650</span>  * @description
<span class='line'>651</span>  * &lt;pre>
<span class='line'>652</span>  * OtherCertID ::= SEQUENCE {
<span class='line'>653</span>  *    otherCertHash    OtherHash,
<span class='line'>654</span>  *    issuerSerial     IssuerSerial OPTIONAL }
<span class='line'>655</span>  * IssuerSerial ::= SEQUENCE {
<span class='line'>656</span>  *    issuer GeneralNames,
<span class='line'>657</span>  *    serialNumber CertificateSerialNumber }
<span class='line'>658</span>  * OtherHash ::= CHOICE {
<span class='line'>659</span>  *    sha1Hash   OtherHashValue,  -- This contains a SHA-1 hash
<span class='line'>660</span>  *    otherHash  OtherHashAlgAndValue}
<span class='line'>661</span>  * OtherHashValue ::= OCTET STRING
<span class='line'>662</span>  * OtherHashAlgAndValue ::= SEQUENCE {
<span class='line'>663</span>  *    hashAlgorithm   AlgorithmIdentifier,
<span class='line'>664</span>  *    hashValue       OtherHashValue }
<span class='line'>665</span>  * &lt;/pre>
<span class='line'>666</span>  *
<span class='line'>667</span>  * @example
<span class='line'>668</span>  * new KJUR.asn1.cades.OtherCertID(certPEM)
<span class='line'>669</span>  * new KJUR.asn1.cades.OtherCertID({cert:certPEM, hasis: false})
<span class='line'>670</span>  */</span><span class="WHIT">
<span class='line'>671</span> </span><span class="NAME">KJUR.asn1.cades.OtherCertID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>672</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>673</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>674</span> </span><span class="WHIT">	</span><span class="NAME">_DERSequence</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.DERSequence</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>675</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cms</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cms</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>676</span> </span><span class="WHIT">	</span><span class="NAME">_IssuerSerial</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cms.IssuerSerial</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>677</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>678</span> </span><span class="WHIT">	</span><span class="NAME">_OtherHashValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.OtherHashValue</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>679</span> </span><span class="WHIT">	</span><span class="NAME">_OtherHashAlgAndValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.OtherHashAlgAndValue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>680</span> 
<span class='line'>681</span> </span><span class="WHIT">    </span><span class="NAME">_KJUR_asn1_cades.OtherCertID.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>682</span> 
<span class='line'>683</span> </span><span class="WHIT">    </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>684</span> 
<span class='line'>685</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>686</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>687</span> 
<span class='line'>688</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>689</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.indexOf</span><span class="PUNC">(</span><span class="STRN">"-----BEGIN"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>690</span> </span><span class="WHIT">		</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">cert</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>691</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_isHex</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>692</span> </span><span class="WHIT">		</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">hash</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>693</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>694</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>695</span> 
<span class='line'>696</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>697</span> 
<span class='line'>698</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dOtherHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>699</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.alg</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT">	    </span><span class="NAME">dOtherHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_OtherHashAlgAndValue</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>701</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>702</span> </span><span class="WHIT">	    </span><span class="NAME">dOtherHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_OtherHashValue</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>703</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>704</span> </span><span class="WHIT">	</span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">dOtherHash</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>705</span> 
<span class='line'>706</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">params.cert</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">params.hasis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
<span class='line'>707</span> </span><span class="WHIT">	    </span><span class="PUNC">(</span><span class="NAME">params.issuer</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">params.serial</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>708</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dIssuerSerial</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_IssuerSerial</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>709</span> </span><span class="WHIT">	    </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">dIssuerSerial</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>710</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>711</span> </span><span class="WHIT">	
<span class='line'>712</span> 	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_DERSequence</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">array</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>713</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">seq.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>714</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>715</span> 
<span class='line'>716</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>717</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>718</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.OtherCertID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>719</span> 
<span class='line'>720</span> </span><span class="COMM">/**
<span class='line'>721</span>  * class for OtherHash ASN.1 object&lt;br/>
<span class='line'>722</span>  * @name KJUR.asn1.cades.OtherHash
<span class='line'>723</span>  * @class class for OtherHash ASN.1 object
<span class='line'>724</span>  * @param {Array} params associative array of parameters
<span class='line'>725</span>  * @extends KJUR.asn1.ASN1Object
<span class='line'>726</span>  * @since jsrsasign 4.7.0 asn1cades 1.0.0
<span class='line'>727</span>  * @link KJUR.asn1.cades.OtherHashAlgAndValue
<span class='line'>728</span>  * @link KJUR.asn1.cades.OtherHashValue
<span class='line'>729</span>  *
<span class='line'>730</span>  * @description
<span class='line'>731</span>  * &lt;pre>
<span class='line'>732</span>  * OtherHash ::= CHOICE {
<span class='line'>733</span>  *    sha1Hash   OtherHashValue,  -- This contains a SHA-1 hash
<span class='line'>734</span>  *    otherHash  OtherHashAlgAndValue}
<span class='line'>735</span>  * OtherHashValue ::= OCTET STRING
<span class='line'>736</span>  * &lt;/pre>
<span class='line'>737</span>  *
<span class='line'>738</span>  * @example
<span class='line'>739</span>  * // OtherHashAlgAndValue with SHA256 by PEM or Hex Cert
<span class='line'>740</span>  * o = new KJUR.asn1.cades.OtherHash({alg: 'sha256', cert: certPEMorHex});
<span class='line'>741</span>  * // OtherHashAlgAndValue with SHA256 by hash value
<span class='line'>742</span>  * o = new KJUR.asn1.cades.OtherHash({alg: 'sha256', hash: '1234'});
<span class='line'>743</span>  * // OtherHashValue(sha1) by PEM or Hex Cert
<span class='line'>744</span>  * o = new KJUR.asn1.cades.OtherHash({cert: certPEM});
<span class='line'>745</span>  * // OtherHashValue(sha1) by PEM or Hex Cert
<span class='line'>746</span>  * o = new KJUR.asn1.cades.OtherHash(certPEMStr);
<span class='line'>747</span>  * // OtherHashValue(sha1) by hash value
<span class='line'>748</span>  * o = new KJUR.asn1.cades.OtherHash("1234");
<span class='line'>749</span>  */</span><span class="WHIT">
<span class='line'>750</span> </span><span class="NAME">KJUR.asn1.cades.OtherHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>751</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_Error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Error</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>752</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>753</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>754</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cms</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cms</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>756</span> </span><span class="WHIT">	</span><span class="NAME">_OtherHashAlgAndValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.OtherHashAlgAndValue</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>757</span> </span><span class="WHIT">	</span><span class="NAME">_OtherHashValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.OtherHashValue</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT">	</span><span class="NAME">_hashHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.crypto.Util.hashHex</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT">	</span><span class="NAME">_isHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.lang.String.isHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>760</span> 
<span class='line'>761</span> </span><span class="WHIT">    </span><span class="NAME">_KJUR_asn1_cades.OtherHash.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>762</span> 
<span class='line'>763</span> </span><span class="WHIT">    </span><span class="NAME">this.params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>764</span> 
<span class='line'>765</span> </span><span class="WHIT">    </span><span class="NAME">this.getEncodedHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>766</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.params</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>767</span> 
<span class='line'>768</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>769</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.indexOf</span><span class="PUNC">(</span><span class="STRN">"-----BEGIN"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>770</span> </span><span class="WHIT">		</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">cert</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>771</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_isHex</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>772</span> </span><span class="WHIT">		</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">hash</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">params</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>773</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>774</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>775</span> 
<span class='line'>776</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dOtherHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>777</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params.alg</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>778</span> </span><span class="WHIT">	    </span><span class="NAME">dOtherHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_OtherHashAlgAndValue</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>779</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>780</span> </span><span class="WHIT">	    </span><span class="NAME">dOtherHash</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_OtherHashValue</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>781</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>782</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">dOtherHash.getEncodedHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>783</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>784</span> 
<span class='line'>785</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">params</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.setByParam</span><span class="PUNC">(</span><span class="NAME">params</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>786</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>787</span> </span><span class="NAME">YAHOO.lang.extend</span><span class="PUNC">(</span><span class="NAME">KJUR.asn1.cades.OtherHash</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Object</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>788</span> 
<span class='line'>789</span> 
<span class='line'>790</span> </span><span class="COMM">// == BEGIN UTILITIES =====================================================</span><span class="WHIT">
<span class='line'>791</span> 
<span class='line'>792</span> </span><span class="COMM">/**
<span class='line'>793</span>  * CAdES utiliteis class
<span class='line'>794</span>  * @name KJUR.asn1.cades.CAdESUtil
<span class='line'>795</span>  * @class CAdES utilities class
<span class='line'>796</span>  * @since jsrsasign 4.7.0 asn1cades 1.0.0
<span class='line'>797</span>  */</span><span class="WHIT">
<span class='line'>798</span> </span><span class="NAME">KJUR.asn1.cades.CAdESUtil</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>799</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>800</span> </span><span class="COMM">/*
<span class='line'>801</span>  *
<span class='line'>802</span>  */</span><span class="WHIT">
<span class='line'>803</span> </span><span class="NAME">KJUR.asn1.cades.CAdESUtil.addSigTS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">dCMS</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">siIdx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sigTSHex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>804</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>805</span> </span><span class="COMM">/**
<span class='line'>806</span>  * parse CMS SignedData to add unsigned attributes
<span class='line'>807</span>  * @name parseSignedDataForAddingUnsigned
<span class='line'>808</span>  * @memberOf KJUR.asn1.cades.CAdESUtil
<span class='line'>809</span>  * @function
<span class='line'>810</span>  * @param {String} hex hexadecimal string of ContentInfo of CMS SignedData
<span class='line'>811</span>  * @return {Object} associative array of parsed data
<span class='line'>812</span>  * @description
<span class='line'>813</span>  * This method will parse a hexadecimal string of 
<span class='line'>814</span>  * ContentInfo with CMS SignedData to add a attribute
<span class='line'>815</span>  * to unsigned attributes field in a signerInfo field.
<span class='line'>816</span>  * Parsed result will be an associative array which has
<span class='line'>817</span>  * following properties:
<span class='line'>818</span>  * &lt;ul>
<span class='line'>819</span>  * &lt;li>version - hex of CMSVersion ASN.1 TLV&lt;/li>
<span class='line'>820</span>  * &lt;li>algs - hex of DigestAlgorithms ASN.1 TLV&lt;/li>
<span class='line'>821</span>  * &lt;li>encapcontent - hex of EncapContentInfo ASN.1 TLV&lt;/li>
<span class='line'>822</span>  * &lt;li>certs - hex of Certificates ASN.1 TLV&lt;/li>
<span class='line'>823</span>  * &lt;li>revs - hex of RevocationInfoChoices ASN.1 TLV&lt;/li>
<span class='line'>824</span>  * &lt;li>si[] - array of SignerInfo properties&lt;/li>
<span class='line'>825</span>  * &lt;li>obj - parsed KJUR.asn1.cms.SignedData object&lt;/li>
<span class='line'>826</span>  * &lt;/ul>
<span class='line'>827</span>  * @example
<span class='line'>828</span>  * info = KJUR.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned(beshex);
<span class='line'>829</span>  * sd = info.obj;
<span class='line'>830</span>  */</span><span class="WHIT">
<span class='line'>831</span> </span><span class="NAME">KJUR.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>832</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>833</span> </span><span class="WHIT">	</span><span class="NAME">_getChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>834</span> </span><span class="WHIT">	</span><span class="NAME">_getTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>835</span> </span><span class="WHIT">	</span><span class="NAME">_getTLVbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLVbyList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>836</span> </span><span class="WHIT">	</span><span class="NAME">_getTLVbyListEx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLVbyListEx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>837</span> </span><span class="WHIT">	</span><span class="NAME">_getIdxbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>838</span> </span><span class="WHIT">	</span><span class="NAME">_getIdxbyListEx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyListEx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>839</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>840</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>841</span> </span><span class="WHIT">	</span><span class="NAME">_ASN1Object</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.ASN1Object</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>842</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cms</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cms</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>843</span> </span><span class="WHIT">	</span><span class="NAME">_SignedData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cms.SignedData</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>844</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cades</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cades</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>845</span> </span><span class="WHIT">	</span><span class="NAME">_CAdESUtil</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cades.CAdESUtil</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>846</span> </span><span class="WHIT">    
<span class='line'>847</span>     </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>848</span> 
<span class='line'>849</span> </span><span class="WHIT">    </span><span class="COMM">// 1. not oid signed-data then error</span><span class="WHIT">
<span class='line'>850</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_getTLVbyList</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"06092a864886f70d010702"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>851</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"hex is not CMS SignedData"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>852</span> 
<span class='line'>853</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iSD</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getIdxbyList</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>854</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aSDChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSD</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>855</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aSDChildIdx.length</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>856</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"num of SignedData elem shall be 4 at least"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>857</span> 
<span class='line'>858</span> </span><span class="WHIT">    </span><span class="COMM">// 2. HEXs of SignedData children</span><span class="WHIT">
<span class='line'>859</span> </span><span class="WHIT">    </span><span class="COMM">// 2.1. SignedData.CMSVersion</span><span class="WHIT">
<span class='line'>860</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSDChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>861</span> </span><span class="WHIT">    </span><span class="NAME">r.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iVersion</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>862</span> 
<span class='line'>863</span> </span><span class="WHIT">    </span><span class="COMM">// 2.2. SignedData.DigestAlgorithms</span><span class="WHIT">
<span class='line'>864</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iAlgs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSDChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>865</span> </span><span class="WHIT">    </span><span class="NAME">r.algs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iAlgs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>866</span> 
<span class='line'>867</span> </span><span class="WHIT">    </span><span class="COMM">// 2.3. SignedData.EncapContentInfo</span><span class="WHIT">
<span class='line'>868</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iEncapContent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSDChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>869</span> </span><span class="WHIT">    </span><span class="NAME">r.encapcontent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iEncapContent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>870</span> 
<span class='line'>871</span> </span><span class="WHIT">    </span><span class="COMM">// 2.4. [0]Certs </span><span class="WHIT">
<span class='line'>872</span> </span><span class="WHIT">    </span><span class="NAME">r.certs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>873</span> </span><span class="WHIT">    </span><span class="NAME">r.revs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>874</span> </span><span class="WHIT">    </span><span class="NAME">r.si</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>875</span> 
<span class='line'>876</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iNext</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSDChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>877</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">iNext</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"a0"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>878</span> </span><span class="WHIT">        </span><span class="NAME">r.certs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iNext</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>879</span> </span><span class="WHIT">        </span><span class="NAME">iNext</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSDChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>880</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>881</span> 
<span class='line'>882</span> </span><span class="WHIT">    </span><span class="COMM">// 2.5. [1]Revs</span><span class="WHIT">
<span class='line'>883</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">iNext</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"a1"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>884</span> </span><span class="WHIT">        </span><span class="NAME">r.revs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iNext</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>885</span> </span><span class="WHIT">        </span><span class="NAME">iNext</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSDChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>886</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>887</span> 
<span class='line'>888</span> </span><span class="WHIT">    </span><span class="COMM">// 2.6. SignerInfos</span><span class="WHIT">
<span class='line'>889</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iSignerInfos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">iNext</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>890</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">iSignerInfos</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"31"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>891</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"Can't find signerInfos"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>892</span> 
<span class='line'>893</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aSIIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSignerInfos</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>894</span> </span><span class="WHIT">    </span><span class="COMM">//alert(aSIIndex.join("-"));</span><span class="WHIT">
<span class='line'>895</span> 
<span class='line'>896</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aSIIndex.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>897</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iSI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSIIndex</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>898</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pSI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_CAdESUtil.parseSignerInfoForAddingUnsigned</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>899</span> </span><span class="WHIT">        </span><span class="NAME">r.si</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pSI</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>900</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>901</span> 
<span class='line'>902</span> </span><span class="WHIT">    </span><span class="COMM">// x. obj(SignedData)</span><span class="WHIT">
<span class='line'>903</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>904</span> </span><span class="WHIT">    </span><span class="NAME">r.obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_SignedData</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>905</span> 
<span class='line'>906</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>907</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.version</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>908</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dCMSVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>909</span> 
<span class='line'>910</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>911</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.algs</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>912</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dDigestAlgs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>913</span> 
<span class='line'>914</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>915</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.encapcontent</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>916</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dEncapContentInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>917</span> 
<span class='line'>918</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>919</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.certs</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>920</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dCerts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>921</span> 
<span class='line'>922</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.signerInfoList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>923</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">r.si.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>924</span> </span><span class="WHIT">        </span><span class="NAME">r.obj.signerInfoList.push</span><span class="PUNC">(</span><span class="NAME">r.si</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>925</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>926</span> 
<span class='line'>927</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>928</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>929</span> 
<span class='line'>930</span> </span><span class="COMM">/**
<span class='line'>931</span>  * parse SignerInfo to add unsigned attributes
<span class='line'>932</span>  * @name parseSignerInfoForAddingUnsigned
<span class='line'>933</span>  * @memberOf KJUR.asn1.cades.CAdESUtil
<span class='line'>934</span>  * @function
<span class='line'>935</span>  * @param {String} hex hexadecimal string of SignerInfo
<span class='line'>936</span>  * @return {Object} associative array of parsed data
<span class='line'>937</span>  * @description
<span class='line'>938</span>  * This method will parse a hexadecimal string of 
<span class='line'>939</span>  * SignerInfo to add a attribute
<span class='line'>940</span>  * to unsigned attributes field in a signerInfo field.
<span class='line'>941</span>  * Parsed result will be an associative array which has
<span class='line'>942</span>  * following properties:
<span class='line'>943</span>  * &lt;ul>
<span class='line'>944</span>  * &lt;li>version - hex TLV of version&lt;/li>
<span class='line'>945</span>  * &lt;li>si - hex TLV of SignerIdentifier&lt;/li>
<span class='line'>946</span>  * &lt;li>digalg - hex TLV of DigestAlgorithm&lt;/li>
<span class='line'>947</span>  * &lt;li>sattrs - hex TLV of SignedAttributes&lt;/li>
<span class='line'>948</span>  * &lt;li>sigalg - hex TLV of SignatureAlgorithm&lt;/li>
<span class='line'>949</span>  * &lt;li>sig - hex TLV of signature&lt;/li>
<span class='line'>950</span>  * &lt;li>sigval = hex V of signature&lt;/li>
<span class='line'>951</span>  * &lt;li>obj - parsed KJUR.asn1.cms.SignerInfo object&lt;/li>
<span class='line'>952</span>  * &lt;/ul>
<span class='line'>953</span>  * NOTE: Parsing of unsigned attributes will be provided in the
<span class='line'>954</span>  * future version. That's way this version provides support
<span class='line'>955</span>  * for CAdES-T and not for CAdES-C.
<span class='line'>956</span>  */</span><span class="WHIT">
<span class='line'>957</span> </span><span class="NAME">KJUR.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>958</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>959</span> </span><span class="WHIT">	</span><span class="NAME">_getChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>960</span> </span><span class="WHIT">	</span><span class="NAME">_getTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>961</span> </span><span class="WHIT">	</span><span class="NAME">_getV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getV</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>962</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>963</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR.asn1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>964</span> </span><span class="WHIT">	</span><span class="NAME">_ASN1Object</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.ASN1Object</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>965</span> </span><span class="WHIT">	</span><span class="NAME">_KJUR_asn1_cms</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1.cms</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>966</span> </span><span class="WHIT">	</span><span class="NAME">_AttributeList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cms.AttributeList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>967</span> </span><span class="WHIT">	</span><span class="NAME">_SignerInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_KJUR_asn1_cms.SignerInfo</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>968</span> 
<span class='line'>969</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>970</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aSIChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSI</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>971</span> </span><span class="WHIT">    </span><span class="COMM">//alert(aSIChildIdx.join("="));</span><span class="WHIT">
<span class='line'>972</span> 
<span class='line'>973</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aSIChildIdx.length</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>974</span> </span><span class="WHIT">        </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"not supported items for SignerInfo (!=6)"</span><span class="PUNC">;</span><span class="WHIT"> 
<span class='line'>975</span> 
<span class='line'>976</span>     </span><span class="COMM">// 1. SignerInfo.CMSVersion</span><span class="WHIT">
<span class='line'>977</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSIChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>978</span> </span><span class="WHIT">    </span><span class="NAME">r.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iVersion</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>979</span> 
<span class='line'>980</span> </span><span class="WHIT">    </span><span class="COMM">// 2. SignerIdentifier(IssuerAndSerialNumber)</span><span class="WHIT">
<span class='line'>981</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSIChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>982</span> </span><span class="WHIT">    </span><span class="NAME">r.si</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iIdentifier</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>983</span> 
<span class='line'>984</span> </span><span class="WHIT">    </span><span class="COMM">// 3. DigestAlgorithm</span><span class="WHIT">
<span class='line'>985</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iDigestAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSIChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>986</span> </span><span class="WHIT">    </span><span class="NAME">r.digalg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iDigestAlg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>987</span> 
<span class='line'>988</span> </span><span class="WHIT">    </span><span class="COMM">// 4. SignedAttrs</span><span class="WHIT">
<span class='line'>989</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iSignedAttrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSIChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>990</span> </span><span class="WHIT">    </span><span class="NAME">r.sattrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSignedAttrs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>991</span> 
<span class='line'>992</span> </span><span class="WHIT">    </span><span class="COMM">// 5. SigAlg</span><span class="WHIT">
<span class='line'>993</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iSigAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSIChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>994</span> </span><span class="WHIT">    </span><span class="NAME">r.sigalg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSigAlg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>995</span> 
<span class='line'>996</span> </span><span class="WHIT">    </span><span class="COMM">// 6. Signature</span><span class="WHIT">
<span class='line'>997</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iSig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aSIChildIdx.shift</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>998</span> </span><span class="WHIT">    </span><span class="NAME">r.sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSig</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>999</span> </span><span class="WHIT">    </span><span class="NAME">r.sigval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iSig</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1000</span> 
<span class='line'>1001</span> </span><span class="WHIT">    </span><span class="COMM">// 7. obj(SignerInfo)</span><span class="WHIT">
<span class='line'>1002</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1003</span> </span><span class="WHIT">    </span><span class="NAME">r.obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_SignerInfo</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1004</span> 
<span class='line'>1005</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1006</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.version</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1007</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dCMSVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1008</span> 
<span class='line'>1009</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1010</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.si</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1011</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dSignerIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1012</span> 
<span class='line'>1013</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1014</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.digalg</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1015</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dDigestAlgorithm</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1016</span> 
<span class='line'>1017</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1018</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.sattrs</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1019</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dSignedAttrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1020</span> 
<span class='line'>1021</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1022</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.sigalg</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1023</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dSigAlg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1024</span> 
<span class='line'>1025</span> </span><span class="WHIT">    </span><span class="NAME">tmp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_ASN1Object</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1026</span> </span><span class="WHIT">    </span><span class="NAME">tmp.hTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.sig</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1027</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dSig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1028</span> 
<span class='line'>1029</span> </span><span class="WHIT">    </span><span class="NAME">r.obj.dUnsignedAttrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">_AttributeList</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1030</span> 
<span class='line'>1031</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1032</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1033</span> 
<span class='line'>1034</span> </span></pre></body></html>